import 'package:flutter/material.dart';
import 'package:module_demo/SimpleCarousel.dart';

/**
 * 列表弹窗
 */
class List extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Home();
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("定制公交",
            style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
        centerTitle: true,
      ),
      drawer: Drawer(),
      body: Container(
        child: Center(
          child: ListView(
            children: [
              Image.asset(
                "images/ai3.jpg",
                height: 250,
                fit: BoxFit.cover,
              ),
              ListTile(leading: Icon(Icons.home), title: Text("出发地点")),
              Divider(),
              ListTile(
                leading: Icon(Icons.lock_clock),
                title: Text("出发时间"),
                onTap: () => {
                  showDatePicker(
                      context: context,
                      initialDate: DateTime.now(),
                      firstDate: DateTime.now(),
                      lastDate: DateTime(2030, 5, 1))
                },
              ),
              Divider(),
              ListTile(
                  leading: Icon(Icons.house_outlined), title: Text("目标地点")),
              Divider(),
              ListTile(
                leading: Icon(Icons.timelapse),
                title: Text("返程时间"),
                onTap: () => {
                  showDatePicker(
                      context: context,
                      initialDate: DateTime.now(),
                      firstDate: DateTime.now(),
                      lastDate: DateTime(2030, 5, 1))
                },
              ),
              Divider(),
            ],
          ),
        ),
      ),
      bottomSheet: ElevatedButton(
        onPressed: () => {
          // showDialog(
          //     context: context,
          //     builder: (BuildContext context) {
          //       return AlertDialog(
          //         title: Text("成功"),
          //         content: Text("提交成功！"),
          //       );
          //     })
          Navigator.push(
              context, MaterialPageRoute(builder: (BuildContext context) =>SimpleCarousel()))
        },
        child: Text("提交"),
      ),
    );
  }
}
